package com.bdweb.dao;

import com.bdweb.model.TASK;

import org.apache.ibatis.annotations.*;


import java.util.List;

@Mapper
public interface TaskDao {
    @Select("select * from bd_task")
    List<TASK> findAll();
    @Select("select * from bd_task where taskName=#{taskName} and start1=#{start1} and end1=#{end1} and start2=#{start2} and end2=#{end2} and ischeckd=#{ischeckd} and mobile=#{mobile}  and updataTime=#{updataTime}" )
    TASK findByNameAndPwd(@Param("taskName") String taskName, @Param("start1") String start1, @Param("end1") String end1, @Param("start2") String start2, @Param("end2") String end2,@Param("ischeckd") boolean ischeckd, @Param("mobile") String mobile , @Param("updataTime") String updataTime);

    @Insert("insert into bd_task values(#{id}, #{taskName}, #{start1} ,#{end1},#{start2} ,#{end2} ,#{ischeckd} ,#{mobile} , #{updataTime} )")
    Integer addByUser(TASK task);
    @Delete("delete from bd_task where id=#{id}")
    Integer deleteTaskById(Integer id);
    @Update("update bd_task set taskName=#{taskName} and start1=#{start1} and end1=#{end1} and start2=#{start2} and end2=#{end2} and ischeckd=#{ischeckd} and mobile=#{mobile} and updataTime= #{updataTime}")
    Integer updateNameAndPwdById(@Param("taskName") String taskName, @Param("start1") String start1, @Param("end1") String end1, @Param("start2") String start2, @Param("end2") String end2 , @Param("ischeckd") boolean ischeckd, @Param("mobile") String mobile,@Param("updataTime") String updataTime);
}
